package com.yilin.tms.order.service.order;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yilin.tms.core.application.PageData;
import com.yilin.tms.core.application.ReturnData;
import com.yilin.tms.core.entity.order.dispatch.DispatchOrder;
import com.yilin.tms.core.entity.order.goods.GoodsOrder;
import com.yilin.tms.core.entity.order.party.OrderDispatchAutoConfig;
import com.yilin.tms.core.entity.order.party.OrderDispatchTask;
import com.yilin.tms.core.entity.order.rob.RobOrder;
import com.yilin.tms.core.entity.user.account.Account;

import java.util.List;

public interface IDispatchService extends IService<DispatchOrder> {

    PageData<DispatchOrder> getDispatchOrderPage(DispatchOrder query, Account loginUser, Integer page, Integer limit);

    DispatchOrder saveDispatchOrder(DispatchOrder dispatchOrder, Account loginUser);

    OrderDispatchTask initiateDispatchOrder(String[] ids, Account loginUser);

    //一键派单，就是将所有派单向转化到货单，并自动生成抢单
    ReturnData<Object> taskDispatchOrder(Account loginUser, DispatchOrder dispatchOrder);

    void updateOrderDispatchTaskById(OrderDispatchTask orderDispatchTask);

    List<DispatchOrder> getDispatchOrderListByNo(List<String> nos);

    //将派单失败的任务所有货源+抢单全部作废
    void dispatchFailRestore(Account account, String dispatchOrderId);

    void updateDispatchAutoConfig(OrderDispatchAutoConfig autoConfig, Account loginUser);

    OrderDispatchAutoConfig getDispatchAutoConfig(Account loginUser);

    List<OrderDispatchTask> getGoingOrderDispatchTaskList();

    OrderDispatchTask getGoingOrderDispatchTask(String shipperOrganizeId);

    List<OrderDispatchTask> getToDayOrderDispatchTask(String shipperOrganizeId);

    //生成抢单
    RobOrder genRobOrder(GoodsOrder goodsOrder);

    DispatchOrder selectDispatchOrder(String id);



}
